home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 008a / perl40_2.zip / USAGE.C < prev    next >
C/C++ Source or Header  |  1991-11-28  |  2KB  |  57 lines

  1. /*    usage.c
  2.  *
  3.  * Show usage message.
  4.  */
  5.  
  6.  
  7. #include <stdio.h>
  8. #include <string.h>
  9.  
  10.  
  11.  
  12.  
  13. usage(char *myname)
  14. {
  15. char    * p;
  16. char     * name_p;
  17.  
  18.  
  19. name_p = myname;
  20. if ( p = strrchr(myname,'/') )
  21.     name_p = p+1;    /* point after final '/' */
  22. #ifdef MSDOS
  23. if ( p = strrchr(name_p,'\\') )
  24.     name_p = p+1;    /* point after final '\\' */
  25. if ( p = strrchr(name_p,':') )
  26.     name_p = p+1;    /* point after final ':' */
  27.   printf("\nUsage: %s [-acdnpsSvw] [-Dnumber] [-i[extension]] [-Idirectory]"
  28. #else
  29.   printf("\nUsage: %s [-acdnpPsSuUvw] [-Dnumber] [-i[extension]] [-Idirectory]"
  30. #endif
  31.          "\n            [-e \"command\"] [-x[directory]] [filename] [arguments]\n", name_p);
  32.  
  33.  
  34.   printf("\n  -a  autosplit mode with -n or -p"
  35.          "\n  -c  syntaxcheck only"
  36.          "\n  -d  run scripts under debugger"
  37.          "\n  -n  assume 'while (<>) { ...script... }' loop arround your script"
  38.          "\n  -p  assume loop like -n but print line also like sed"
  39. #ifndef MSDOS
  40.          "\n  -P  run script through C preprocessor befor compilation"
  41. #endif
  42.          "\n  -s  enable some switch parsing for switches after script name"
  43.          "\n  -S  look for the script using PATH environment variable");
  44. #ifndef MSDOS
  45.   printf("\n  -u  dump core after compiling the script"
  46.          "\n  -U  allow unsafe operations");
  47. #endif
  48.   printf("\n  -v  print version number and patchlevel of perl"
  49.          "\n  -w  turn warnings on for compilation of your script\n"
  50.          "\n  -Dnumber        set debugging flags"
  51.          "\n  -i[extension]   edit <> files in place (make backup if extension supplied)"
  52.          "\n  -Idirectory     specify include directory in conjunction with -P"
  53.          "\n  -e command      one line of script, multiple -e options are allowed"
  54.          "\n                  [filename] can be ommitted, when -e is used"
  55.          "\n  -x[directory]   strip off text before #!perl line and perhaps cd to directory\n");
  56. }
  57.